<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>使用openlayers调用Arcgis Server REST的瓦片地图服务</title>
    <link rel="stylesheet" href="css/ol.css" />
    <script src="js/ol.js"></script>
    <script src="js/jquery-1.11.2.min.js"></script>
    <style type="text/css">
        #mapCon {
            width: 100%;
            height: 95%;
            position: absolute;
        }
    </style>
</head>
<body>
<div id="mapCon"></div>
<script type="text/javascript">
    //实例化Map对象加载地图
    var key = 'Q57tupj2UBsQNQdju4xL~xBceblfTd6icjljunbuaCw~AhwA-whmGMsfIpVhslZyknWhFYq-GvWJZqBnqV8Zq1uRlI5YM_qr7_hxvdgnU7nH';
    var roads = new ol.layer.Tile({
        source: new ol.source.BingMaps({ key: key, imagerySet: 'Road' })
    });
    var map = new ol.Map({
        layers: [roads],
        target: 'mapCon',
        view: new ol.View({
            center: ol.proj.fromLonLat([-109, 46.5]),
            zoom: 6
        })
    });
</script>
</body>
</html>